package com.luyou.a03;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * Bean的生命周期
 * @author 28336
 * @version 1.0
 * Create by 2023/12/7 20:00
 */
@SpringBootApplication
public class A03Application {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(A03Application.class, args);
        // 调用 close 方法，显示生命周期的销毁阶段 见LifeCycleBean
        System.out.println(context.getBean(LifeCycleBean.class));
        context.close();
    }
}
